Setup DataStream on Akamai Manually
IO River can provide extensive traffic analytics, even if you still manage the domain on Akamai. To do that, add DataStream2 to your domain to deliver sample traffic to IO River.
Prefer automation? See Automate with Script.
Process
In the Akamai Control Center, navigate to Investigate to Common Services > DataStream. Click Create Stream and choose Delivery Products.
- In Step 1 Configuration
- In Display Name enter a name for your stream (we recommend including the name of your property)
- Select the Property Group
- Under Latency Profile select Optimized for faster latency
- Under Include Properties Select the property you need
- Click Next
- In Step 2 Data Sets
- Select the following data items
- Log information: CP Code, Request ID, Request Time
- Message exchange data: Client IP, HTTP status code, Protocol type, Request host, Request method, Request path, Response Content-Length, User-Agent, Total bytes
- Request header data: Cookie, Referer
- Network performance data: Turn around time, Asnum
- Cache data: Cache status, Breadcrumbs
- Geo data: Country/Region, City, Edge IP
- Common media client data: CMCD
- Custom fields: Custom field
- Under Log file
- Set Log format to Json
- Click Next
- Select the following data items
- In Step 3 Delivery
- Under Destination
- Set Destination to Custom HTTPS
- In Display Name enter a name for your stream (we recommend including the name of your property)
- Leave Authentication as None
- In Endpoint enter https://traffic-reporting.ioriver.io/public/akamai/:service_uid:/stats/akamai-:service_uid:_stats
- Replace
:service_uid:with the value for your service - contact IO River for details.
- Replace
- Click Validate & Save
- Under Delivery options
- Set Push frequency to 60 Seconds
- Set Sampling rate to 100%
- Click Next
- Under Destination
- In Step 4 Summary
- Review the configuration
- Click Save stream
Navigate to CDN > Properties. Select the property, and click New Version
- In Property Configuration Settings select the default rule
- Click +Behavior, and select Standard property behavior
- In the dialog find DataStream behavior, and click Insert Behavior
- In the list of behaviors of the rule, find the DataStream behavior
- Set Stream version to DataStream2, and click Enable
- In Stream names, select the stream you created earlier
- Set the sampling rate to 10%
- Click +Behavior, and select Standard property behavior
- In the dialog find Log Request Details behavior, and click Insert Behavior
- In the list of behaviors of the rule, find the Log Request Details behavior
- Enable Log Referer Header
- Enable Log User-Agent Header
- Set Cookie mode to ???
- ???
- Enable Include Custom Log Field
- ???
- Enable Log Akamai Edge Server IP Address
- Click Save and activate the new version
Automate with Script
You can automate this setup (create a DataStream2 stream and update the property behaviors) by downloading and running the script below:
- Script URL: setup_akamai_datastream2.py
Example:
python3 setup_akamai_datastream2.py \
--property-name <your_property_name> \
--host <your_akamai_api_host> \
--client-token <your_client_token> \
--client-secret <your_client_secret> \
--access-token <your_access_token> \
--service-uid <your_service_uid>
The script creates or reuses the DataStream and updates the property behaviors on a new property version. You still need to activate that new version in Akamai.